package com.andatsoft.laisim.dialog;

import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.widget.TextView;

import com.andatsoft.laisim.R;
import com.andatsoft.laisim.activity.BaseActivity;

public class ChangelogDialog extends BaseActivity {

	private TextView mTvOk;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		getWindow().requestFeature(Window.FEATURE_NO_TITLE);
		getWindow().setBackgroundDrawable(
				new ColorDrawable(getResources().getColor(R.color.black)));
		setContentView(R.layout.dialog_change_log);
		initViews();
		setupListeners();
	}

	private void initViews() {
		mTvOk = (TextView) findViewById(R.id.tv_ok_setting_about_change_log);
	}

	private void setupListeners() {
		mTvOk.setOnTouchListener(new OnTouchListener() {

			@Override
			public boolean onTouch(View v, MotionEvent event) {
				switch (event.getAction()) {
				case MotionEvent.ACTION_DOWN:
					setAlpha(v, 0.5f);
					return true;

				case MotionEvent.ACTION_UP:
					setAlpha(v, 1.0f);
					ChangelogDialog.this.finish();
					return true;
				}
				return false;
			}
		});
	}
}
